<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page language="java" import="com.tjtt.common.utils.DateUtilsAll"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <base target="_self"/>
    <link rel="stylesheet" type="text/css" href="<%=path %>/web/style/layout.css" />
    <script type="text/javascript" src="<%=path %>/jqGrid/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="<%=path %>/jslib/jquery.validate.min.js"></script>
    <script type='text/javascript' src="<%=request.getContextPath() %>/jslib/My97DatePicker/WdatePicker.js" defer="defer"></script>
    <script type='text/javascript' src="<%=request.getContextPath() %>/jslib/jquery.form.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/jslib/additional-methods.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/demo.css">
	<script type="text/javascript" src="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>
    <c:if test="${requestScope.message!=null}">
		<script type="text/javascript">
 	 		     alert('<c:out value="${requestScope.message}"></c:out>');
 	 		     window.close();
 		</script>
	</c:if>
	
	<script type="text/javascript">
		var api = frameElement.api, W = api.opener;
    	var stateValue="";
		$().ready(function(){
			var options = {
		  	    url:'<%=request.getContextPath() %>/shebeitouruAction!jiekourenchuli.action?steptype='+$("#steptype0").val()+'&taskinfoid='+${taskinfoid},
		  	     beforeSubmit: function() {
		   				return true;
		    			},
		  	    dataType:'json',
		  	    success: function(data) {
		  	      if(data.result=='success'){
					alert("提交成功");
					api.close();
					W.refreshIt();
		  	      }
		  	    }
		  	   };
			$('#saveBtn').click(function(){
				    	$('#pageFrom').ajaxSubmit(options);
		 	            return false;
	    	 });
	    	$('#closeBtn').click(function(){
	    		api.close();
				//window.close();
			});
		});
		/* function checking(){
	   		var flag = true;
			var app_jiekouren = $("#app_jiekouren").val();
			var app_pinshenjielun = $("#app_pinshenjielun").val();
			var app_jieshoutime = $("#app_jieshoutime").val();
			if(app_jiekouren ==null || app_jiekouren == "" ){
				alert("接口人不能为空！");
				$("#app_jiekouren").focus();
	    		return false;
			}
			if(app_pinshenjielun == null && app_pinshenjielun == ""){
				alert("评审结论不能为空！");
				$("#app_pinshenjielun").focus();
	    		return false;
			}
			if(app_jieshoutime ==null || app_jieshoutime == "" ){
				alert("时间不能为空！");
				$("#app_jieshoutime").focus();
	    		return false;
			}
			
		} */
		
		function dahui(){
        var actionUrl = '<%=request.getContextPath()%>/shebeitouruAction!tuihuishebei.action'; 
        var param = {
                      "flowname":$("#flowname").val(),
                      "flowid":"${flowid}",
                      "stateid":"${stateid}",
                      "steptypeback":$("#steptypeback0").val(),
                      "taskinfoid":"${taskinfoid}",
                      "id":$("#id").val()
            };
    	$.ajax({  
			        url : actionUrl,  
			        type : "post", 
			        data : param,  
			        dataType : "json",  
			        cache : false,  
			 error : function(textStatus, errorThrown) {  
			        alert("系统ajax交互错误: " + textStatus.value);  
		    },  
		    success : function(data, textStatus) {
		        if(data.ajaxResult=='success'){ 
		        //      window.returnValue = returnValue;     
				      alert("打回成功");
				      W.reload();
					  api.close();
                   }else{
                       alert("处理失败!");
                       W.reload();
                   }
		    }    
			});
    }
		
	</script>
  </head>
  
  <body>
    <form id="pageFrom" action="" enctype="multipart/form-data" method="post">
        <input type="hidden" id="flag" name="flag" />
        <input type="hidden" name="flowid" id="flowid" value="${flowid}">
     	<input type="hidden" name="stateid" id="stateid" value="${stateid}">
     	${steptcontent}
  		${steptcontentback }
     	<input type="hidden" readonly="readonly" id="id" name="id" value="${shebeitouru.id }"/>
  		<table width="100%" border="0" align="center" cellpadding="5" cellspacing="5" class="formTableNew" style="padding-top: 20px">
  			 <tr>
			  	<td align="right">流程名称:</td>
			  <td align="left">
			  	<input type="text" id="flowname" name="flowname" maxlength="50" value="${flowname}" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;">
			  </td>
     		<td>
  			</tr>
  			<tr>
  			  <td align="right">评审结果: </td>
  			  <td align="left">
  			    <input  type="radio" name="pinshenjieguo"  value="" />自制
  			    <input  type="radio" name="pinshenjieguo"  value="" />采购
  			    <input  type="radio" name="pinshenjieguo"  value="" />资源协调
  			    <input  type="radio" name="pinshenjieguo"  value="" />改造
  			    <input  type="radio" name="pinshenjieguo"  value="" />取消
  			    <input  type="radio" name="pinshenjieguo"  value="" />其他
  			  </td>
  			  <td align="right">回复意见：</td>
  			  <td align="left">
  			    <input  type="text" id="huifuyijian" maxlength="50" name="huifuyijian" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			  </td>
  			 </tr>
  			<tr>
  			  <td align="right">采购接口人:</td>
  			  <td align="left">
  			    <input  type="text"  id="caijiekouren"  maxlength="50" name="caijiekouren" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="<%=session.getAttribute("username") %>" />
  			  </td>
  			  <td align="right">接收时间：</td>
  			  <td align="left">
  			    <input  type="text"  id="jieshoutime"  maxlength="50" name="jieshoutime" onChange="changeDate()" onClick="WdatePicker({maxDate:new Date()})" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="<%=DateUtilsAll.dateToStringShort(new Date()) %>" />
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">附件:</td>
  			  <td align="left">
  			  	<jsp:include page="../fileupload/attachment.jsp?id=${requestScope.id }&column=caigoufujian&show=n" ></jsp:include>
  			  </td>
  			</tr>
		</table>
		<table width="100%" border="0" align="center" class="formTableNew">
		  <tr>   
			<td align="center">
		    	<input id="saveBtn" type="button" value="提 交" class="form_bt_orange" />
		    	<input type="button" id="backBtn" value="退回" onclick="dahui()" class="form_bt_orange" />
		    	<input type="button" id="closeBtn" value="取 消" class="form_bt_grey" />
		    </td>
		  </tr>
		</table>
	<!--表单结束-->
	</form>
  </body>
</html>
